package cc.wsyw126.java.nowcoder.weizhongyinhang;

import java.util.HashSet;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/4/25.
 * 判断八个点，即四条线，能否组成矩形。且平行于坐标轴。
 */
public class one {
    public static void main(String[] args) throws Exception {
        one one = new one();
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n =4;
            String result = "NO";
            HashSet<Integer> setX = new HashSet<>();
            HashSet<Integer> setY = new HashSet<>();
            HashSet<node> nodes = new HashSet<>();
            while (n-->0) {
                try {
                    String s1 = sc.nextLine();
                    String[] split = s1.split(" ");
                    int n1  = Integer.valueOf(split[0]), n2 = Integer.valueOf(split[1]), n3 = Integer.valueOf(split[2]), n4= Integer.valueOf(split[3]);
                    node node = one.new node(n1, n2);
                    node node1 = one.new node(n3, n4);
                    nodes.add(node);
                    nodes.add(node1);
                    if (n1==n3&&n2==n4) {
                        continue;
                    }
                    if (n1 == n3 ) {
                        setX.add(n1);
                    } else if (n2==n4){
                        setY.add(n2);
                    }
                } catch (Exception e) {
                    break;
                }
            }
            if (setX.size() ==2&& setY.size()==2 && nodes.size() ==4) {
                result="YES";
            }
            System.out.println(result);
        }
    }
    private class node{
        int x;
        int y;

        public node(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            node node = (node) o;

            if (x != node.x) return false;
            return y == node.y;

        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }
    }
}
